import pymysql
conn=pymysql.connect(user="root",
                     password='hhf20101',
                     host='localhost',
                     database='books',
                     autocommit=False)
cursor=conn.cursor()
sql="delete from t_book where id=4;"
cursor.execute(sql)
print(cursor.rowcount)
conn.commit()
cursor.close()
conn.close()